             yy<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', system-ui, sans-serif;
        }

        body {
            background-color: #f5f5f5;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }

        .login-container {
            background-color: white;
            width: 100%;
            max-width: 350px;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .login-container h1 {
            text-align: center;
            color: #333;
            margin-bottom: 25px;
            font-size: 24px;
        }

        .input-group {
            margin-bottom: 20px;
        }

        .input-group label {
            display: block;
            margin-bottom: 6px;
            color: #555;
            font-size: 14px;
        }

        .input-group input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 16px;
            transition: border 0.3s;
        }

        .input-group input:focus {
            border-color: #4285f4;
            outline: none;
        }

        .password-group {
            position: relative;
        }

        .toggle-password {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #888;
            cursor: pointer;
        }

        .options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
            font-size: 14px;
        }

        .remember-me {
            display: flex;
            align-items: center;
        }

        .remember-me input {
            margin-right: 6px;
        }

        .options a {
            color: #4285f4;
            text-decoration: none;
        }

        .options a:hover {
            text-decoration: underline;
        }

        .login-btn {
            width: 100%;
            padding: 12px;
            background-color: #4285f4;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.3s;
        }

        .login-btn:hover {
            background-color: #3367d6;
        }

        .register-link {
            text-align: center;
            margin-top: 20px;
            font-size: 14px;
            color: #555;
        }

        .register-link a {
            color: #4285f4;
            text-decoration: none;
        }

        .register-link a:hover {
            text-decoration: underline;
        }

        .back-link {
            text-align: center;
            margin-top: 15px;
            font-size: 14px;
        }

        .back-link a {
            color: #666;
            text-decoration: none;
        }

        .back-link a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <h1>用户登录</h1>
        <!-- 添加了action和method属性 -->
        <form id="loginForm" action="/login" method="GET">
            <!-- 用户名输入，添加了name属性 -->
            <div class="input-group">
                <label for="username">用户名</label>
                <input type="text" id="username" name="username" placeholder="请输入用户名" required>
            </div>

            <!-- 密码输入，添加了name属性 -->
            <div class="input-group password-group">
                <label for="password">密码</label>
                <input type="password" id="password" name="password" placeholder="请输入密码" required>
                <button type="button" class="toggle-password" id="togglePassword">👁️</button>
            </div>

            <!-- 记住我选项，添加了name属性 -->
            <div class="options">
                <label class="remember-me">
                    <input type="checkbox" id="remember" name="remember" value="1"> 记住我
                </label>
                <a href="#">忘记密码？</a>
            </div>

            <button type="submit" class="login-btn">登录</button>

            <p class="register-link">
                还没有账号？<a href="register.html">立即注册</a>
            </p>

            <p class="back-link">
                <a href="index.html">返回首页</a>
            </p>
        </form>
    </div>

    <script>
        // 密码显示/隐藏切换
        const toggleBtn = document.getElementById('togglePassword');
        const passwordInput = document.getElementById('password');

        toggleBtn.addEventListener('click', () => {
            const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
            passwordInput.setAttribute('type', type);
            toggleBtn.textContent = type === 'password' ? '👁️' : '👁️‍🗨️';
        });

        // 表单提交处理
        document.getElementById('loginForm').addEventListener('submit', (e) => {
            // 实际项目中可以在这里添加前端验证逻辑
            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;
            
            if (!username || !password) {
                e.preventDefault();
                alert('请输入用户名和密码');
                return;
            }
            
            // 如果需要使用AJAX提交，可以取消默认提交行为
            // e.preventDefault();
            // 然后使用fetch或axios发送请求
            console.log('登录信息将提交到:', '/api/login');
        });
    </script>
</body>
</html>
